<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" href="css/ui-base.css">
    <link rel="stylesheet" href="css/ui-box.css">
    <link rel="stylesheet" href="css/ui-color.css">
	<link rel="stylesheet" href="css/ui-res.css">
	<link rel="stylesheet" href="css/ui-img.css">
	<link rel="stylesheet" href="css/ui-tab.css">
    <script src="js/zy_control.js"></script>
	<script src="js/jquery-2.0.0.js"></script>
    <script src="js/zy_click.js"></script>
	<script src="js/json.js"></script><script src="js/base.js"></script>
    <script src="js/weiboFun.js"></script>
	<script src="js/zy_tmpl.js"></script>
</head>
<body class="um-vp c-wh" ontouchstart>
    <div id="page_0" class="up ub ub-ver" tabindex="0">
        <!--header开始-->
         <div id="header" class="uh  t-wh ub" style="background-color:#222a38;"  >
        	<div class="umw4 ver-txc2" ontouchstart="zy_touch()" onclick="backWeiboList()">
            <!--插入按钮控件--><img  class=" mar-l5 max-w1 max-h1" src="css/img/arrow2.png">
        	</div>
            <h1 class="ut ub-f1 ulev0 ut-s tx-c">微博正文</h1>
			<div class="umw4 imgWriter" ontouchstart="zy_touch()" onclick="">
            <!--插入按钮控件-->
        	</div>
        </div>
        <!--header结束--><!--content开始-->
        <div id="content" class="ub-f1 tx-l t-bla ub  ub-ver">
            
        </div>
        <!--content结束--><!--footer开始-->
        <div id="footer" class="uf  t-wh" style="background-color:#4a4a4a">
          
        </div>
        <!--footer结束-->
    </div>
</body>
<script>
	var tmpl_footer_yes='<div class="ub c-bla tab t-wh" onload="init()">'	
		 		+'<input id="index" class="uhide" type="radio" name="tabSwitch" >'
					+'<div ontouchstart="zy_touch('+',zy_for)" class="ub-f1 ub ub-ver tab-act" onclick="tabFunction('+'this'+')" id="forward"><div class="ub-f1 ub-img5 imgShare " style="margin-top:0.2em"></div><div class="uinn ulev-2 tx-c">转发</div></div>'
		 		+'<input id="public" class="uhide" type="radio" name="tabSwitch">'
					+'<div ontouchstart="zy_touch('+',zy_for)" class="ub-f1 ub ub-ver tab-act" onclick="tabFunction('+'this'+')" id="comment"><div class="ub-f1 ub-img5 imgCom" style="margin-top:0.2em"></div><div class="uinn ulev-2 tx-c">评论</div></div>'
				+'<input id="per" class="uhide" type="radio" name="tabSwitch">'
					+'<div ontouchstart="zy_touch('+',zy_for)" class="ub-f1 min-w2 ub ub-ver tab-act" onclick="tabFunction('+'this'+')" id="collect"><div id="star" class="ub-f1 ub-img5 imgUnStar" style="margin-top:0.2em"></div><div id="collect" class="uinn  ulev-2 tx-c">收藏</div></div>'
				+'<input class="uhide" type="radio" name="tabSwitch">'
					+'<div ontouchstart="zy_touch('+',zy_for)" class="ub-f1 ub ub-ver tab-act" onclick="tabFunction('+'this'+')"><div class="ub-f1 ub-img5 imgThree " style="margin-top:0.2em"></div><div class="uinn ulev-2 tx-c">更多</div></div>'
			+'</div>';
			var tmpl_footer_no='<div class="ub c-bla tab t-wh" onload="init()">'	
		 		+'<input id="index" class="uhide" type="radio" name="tabSwitch" >'
					+'<div ontouchstart="zy_touch('+',zy_for)" class="ub-f1 ub ub-ver tab-act" onclick="tabFunction('+'this'+')"id="forward"><div class="ub-f1 ub-img5 imgShare " style="margin-top:0.2em"></div><div class="uinn ulev-2 tx-c">转发</div></div>'
		 		+'<input id="public" class="uhide" type="radio" name="tabSwitch">'
					+'<div ontouchstart="zy_touch('+',zy_for)" class="ub-f1 ub ub-ver tab-act" onclick="tabFunction('+'this'+')"id="comment"><div class="ub-f1 ub-img5 imgCom" style="margin-top:0.2em"></div><div class="uinn ulev-2 tx-c">评论</div></div>'
				+'<input id="per" class="uhide" type="radio" name="tabSwitch">'
					+'<div ontouchstart="zy_touch('+',zy_for)" class="ub-f1 min-w2 ub ub-ver tab-act" onclick="tabFunction('+'this'+')"id="collect"><div id="star" class="ub-f1 ub-img5 imgStar" style="margin-top:0.2em"></div><div id="collect" class="uinn  ulev-2 tx-c">收藏</div></div>'
				+'<input class="uhide" type="radio" name="tabSwitch">'
					+'<div ontouchstart="zy_touch('+',zy_for)" class="ub-f1 ub ub-ver tab-act" onclick="tabFunction('+'this'+')"><div class="ub-f1 ub-img5 imgThree " style="margin-top:0.2em"></div><div class="uinn ulev-2 tx-c">更多</div></div>'
			+'</div>';
zy_init();

window.uexOnload = function(type){
	
    if (!type) {
		var footer=$$("footer");
		var weibo_id=window.localStorage["weiboDetail_id"];
		
		var url='http://www.diaoyumi.ourstu.com/api/weibo/getWeibo?session_id='+window.localStorage["session_id"]+'&weibo_id='+weibo_id+'&';
		var httpID=13124;
		uexXmlHttpMgr.onData=function(inOpCode,inStatus,inResult){
			if(inStatus==1){
				var json=eval("("+inResult+")");
				if (json["success"]) {
					var weibo=json["weibo"];
					if(weibo["is_bookmark"]){
						
						var obj=window.localStorage["WeiboWeiboList"];
						var content=document.createElement('DIV');
						var weibo=zy_tmpl_s(tmpl_footer_yes,obj,zy_tmpl_count(obj));		
						content.innerHTML=weibo;
						footer.appendChild(content);
						 zy_con("content", "weiboDetail_content.html", 0, $$("header").offsetHeight);
					}else{
						var obj=window.localStorage["WeiboWeiboList"];
						var content=document.createElement('DIV');
						var weibo=zy_tmpl_s(tmpl_footer_no,obj,zy_tmpl_count(obj));		
						content.innerHTML=weibo;
						footer.appendChild(content);
						 zy_con("content", "weiboDetail_content.html", 0, $$("header").offsetHeight);
					}
					
				}else{
					uexWindow.toast(1,5,"请刷新",500);
					return false;
				}	
			}
		}
		uexXmlHttpMgr.open(httpID,'get',url,3000);
		uexXmlHttpMgr.send(httpID);
	
       
    }
	window.onorientationchange=window.onresize=function(){
		zy_resize("content",0,$$("header").offsetHeight);				
	}
	
}


function backWeiboList(){
	
	
	uexWindow.open("weiboList",0,"weiboList.html",1,"","",0,450);
	uexWindow.close();
}
function tabFunction(obj){
	var type=obj.id;
	if(type=="forward"){
		uexWindow.open("forward",0,"forward.html",1,"","",0,450);
		uexWindow.close();
	}else if(type=="comment"){
		uexWindow.open("comment",0,"comment.html",1,"","",0,450);
		uexWindow.close();
	}
	else if(type=="collect"){
		collectWeibo();
	}else{
	
	}
}

function collectFun(){
	/*
var httpID=120;
	uexXmlHttpMgr.onData=function (inOpCode,inStatus,inResult){
		if(inStatus==1){
			var json=JSON.parse(inResult);
			if(json["success"]){
				uexWindow.toast(1,5,"收藏成功",1000);
				$('#collect').text("收藏");
				$('#collect').removeClass("imgStar");
				$('#collect').addClass("imgUnStar");
				uexXmlHttpMgr.close(httpID);
			}
		}
	};
	uexXmlHttpMgr.open(httpID,'post',url,3000);
	uexXmlHttpMgr.setPostData("session_id",window.localStorage["session_id"]);
	uexXmlHttpMgr.setPostData("weibo_id",window.localStorage["weibo_id"]);
	uexXmlHttpMgr.send(httpID);
*/
	var txt=$('#collect').text();
	if(txt=="收藏"){
		$('#collect').text("收藏");
		$('#star').removeClass("imgStar");
		$('#star').addClass("imgUnStar");
		uexWindow.toast(1,5,"收藏成功,再点击取消收藏",1000);
	}else{
		$('#collect').text("收藏");
		$('#star').removeClass("imgUnStar");
		$('#star').addClass("imgStar");
		uexWindow.toast(1,5,"取消收藏成功，点击收藏",1000);
	}
	
}
</script>
</html>
